import request from "@/utils/request";
import { stringify } from "qs";

// 采购单列表
export async function getPurchaseorderList(params) {
	return request(`/new-wms/purchaseorder/select-purchase-order-page`, {
		method: "Post",
		data: params,
		loading: true
	});
}
// 采购单商品详情
export async function getPurchaseorderDetailList(params) {
	return request(`/new-wms/purchaseorder/select-es-purchase-order-detail?${stringify(params)}`, {
		loading: true
	});
}

// 审核通过采购单
export async function purchaseorderAuditPass(params) {
	return request(`/new-wms/purchaseorder/audit-pass`, {
		method: "Post",
		data: params,
		loading: true
	});
}

// 作废采购单
export async function purchaseorderCancelled(params) {
	return request(`/new-wms/purchaseorder/cancelled`, {
		method: "Post",
		data: params,
		loading: true
	});
}
// 强制完成采购单
export async function purchaseorderForcedComplete(params) {
	return request(`/new-wms/purchaseorder/forced-complete`, {
		method: "Post",
		data: params,
		loading: true
	});
}
// 重新指派
export async function purchaseorderReassign(params) {
	return request(`/new-wms/purchaseorder/reassign`, {
		method: "Post",
		data: params,
		loading: true
	});
}

// 拿货员列表
export async function queryTakeUserList(params) {
	return request(`/blade-user/childUsers?${stringify(params)}`, { loading: true });
}
// 日志
export async function getLogsPage(params) {
	return request(`/new-wms/logs/page?${stringify(params)}`, { loading: true });
}

// 打印采购单
export async function purchaseorderPrintt(params) {
	return request(`/new-wms/purchaseorder/print`, {
		method: "post",
		data: params,
		loading: true
	});
}

// 获取采购单打印数据
export async function getPurchaseOrderPrintData(params) {
	return request(`/new-wms/kuaimai/getPurchaseOrderPrintData`, {
		method: "post",
		data: params,
	});
}

// 获取采购单模板列表
export async function queryLabelTemplate(params) {
	return request(`/new-common/labelTemplate/list`, {
		method: "post",
		data: params,
	});
}

